<template>
	<view style="background-color: #f7f8fa; height: 100vh;">
		<view class="container">
			<view class="header">
				<view class="header-bg"></view>
				<view class="header-hd">
                {{score}}					
				</view>
				<view class="amount">
					<view class="amount-use">
						<view class="amount-able">
							可用余额
						</view>
						<view class="amount-value">
							 {{balance}}	
						</view>
					</view>
					<view class="amount-use">
						<view class="amount-able">
							冻结余额
						</view>
						<view class="amount-value">
							 {{totalPayAmount}}	
						</view>
					</view>
					<view class="amount-use">
						<view class="amount-able">
							累计余额
						</view>
						<view class="amount-value">
							 {{totalPayNumber}}	
						</view>
					</view>
				</view>
				
			</view>
			<view class="btn" @click="golden">
           
           <view class="gold">
			    <i>￥</i>
           	资金记录
           </view>
		   <span>&gt;</span>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				token:"",
				score:"",
				balance:"",
				totalPayAmount:"",
               totalPayNumber:""
			}
		},
		mounted() {
			this.getThing()
		},
		methods: {
			getThing(){
				let that = this;
				uni.request({
					url:"https://api.it120.cc/xiaochengxu/user/amount?token="+that.token,
					type:"get",
					dataType: "json",
		            data:{
						token:that.token
					},
					header:{
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					success: function(res) {
					      console.log(res)
						  that.score =res.data.data.score
						  that.balance =res.data.data.balance
						  that.totalPayAmount =res.data.data.totalPayAmount
						  that.totalPayNumber =res.data.data.totalPayNumber
					     }
				})
			},
			onLoad() {
			   let that =this
			   uni.getStorage({
			     key: 'token',
			     success: function(res) {
			      
			      console.log(res.data);
			      that.token = res.data
			     }
			    })
			   
			
			  },
			golden(){
				uni.navigateTo({
					url:'/pages/deel/deel'
				})
			}
		}
	}
</script>

<style scoped lang="scss">

	.container{
		display: flex;
		justify-content: center;
		flex-direction: column;
		align-items: center;
		
	}
.header{
	    box-sizing: border-box;
	    position: relative;
	    height: 40vw;
	    margin: 2.67vw 0;
		padding-left: 5.33vw;
		padding-right: 5.33vw;
	    padding-top: 5.33vw;
        width: 89.44vw;
	    border-radius: 2.13vw;
	    background: -webkit-linear-gradient(60deg,#f2c379,#e2a850);
	    background: linear-gradient(30deg,#f2c379,#e2a850);
	    font-size: 3.73vw;
	    color: #fff;
		.header-bg{
			    position: absolute;
			    top: 0;
			    right: 0;
			    bottom: 0;
			    left: 0;
			    background: url(../../static/fff.png) 50%/cover no-repeat;
		}
		.header-hd{
			    font-size: 4.8vw;
			    font-weight: 700;
			    margin-bottom: 5.33vw;
		}
		.amount{
			display: flex;
			justify-content: space-around;
			.amount-use{
				text-align: center;
				.amount-able{
					font-size: 2.67vw;
					margin-bottom: 2vw;
				}
			}
		}
}
.btn{
	    position: relative;
	    display: flex;
	    box-sizing: border-box;
	    width: 100%;
	    padding: 2.67vw 4.27vw;
	    overflow: hidden;
	    background-color: white;
		justify-content: space-between;
	    font-size: 3.73vw;
	    line-height: 6.4vw;
		height: 12vw;
		width: 89.44vw;
		i{
			height: 90%;
			width: 6%;
			color: #f2c379;
			border-radius: 50%;
			border: #e2a850 1px solid;
			margin-right: 1vw;
		}
		span{
			font-size: 6vw;
			color: grey;
			margin-left: 45vw;
		}
	
}
</style>
